package finalgame.GUI;

import finalgame.Game;
import finalgame.Util;
import finalgame.Engine.pokemon.Pokemon;
import finalgame.Engine.trainer.Trainer;
import finalgame.Graphics.Location;

public class DeleteMenu extends TextMenu {
	public DeleteMenu() {
		strings = extractPokemon();
		baseLoc = new Location(30, 0);
		currentTitle = "Delete a pokemon.";
	}
	
	/**
	 * Extract pokemon from trainer
	 * @param me
	 * @return An array of the names of all the 
	 */
	private String[] extractPokemon() {
		Pokemon[] tp = Game.game.hero.getTrainer().getPokemonInventory();
		int size = Util.getSize(tp);
		String[] names = new String[tp.length];
		for(int i = 0; i < size; i++) {
			names[i] = tp[i].getClass().getSimpleName();
		}
		return names;
	}
	
	public void select() {
		Game.game.hero.getTrainer().removePokemon(sel_index);
		strings = extractPokemon();
		sel_index = Util.bound(sel_index, 0, Util.getSize(strings));
	}
	
	public void exit() {
		Game.exit();
	}

}
